package com.company.project.entity;

import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.io.Serializable;
import java.util.Date;

/**
 * 权限菜单
 *
 * @author ZhangYu
 * @version V1.0
 * @date 2020年12月12日
 */
@Data
public class SysPermission implements Serializable {


    @TableId
    private String id;

    @ApiModelProperty("菜单权限名称")
    @NotBlank(message = "菜单权限名称不能为空")
    private String name;

    @ApiModelProperty("授权")
    private String perms;

    @ApiModelProperty("访问地址url")
    private String url;

    @ApiModelProperty("图标")
    private String icon;

    @ApiModelProperty("菜单权限名称")
    private String target;

    @ApiModelProperty("父级菜单权限id")
    @NotNull(message = "所属菜单不能为空")
    private String pid;

    @ApiModelProperty("排序")
    private Integer orderNum;

    @ApiModelProperty("菜单权限类型(1:目录;2:菜单;3:按钮)")
    @NotNull(message = "菜单权限类型不能为空")
    private Integer type;

    @ApiModelProperty("状态1:正常 0：禁用")
    private Integer status;

    @ApiModelProperty("创建时间")
    @TableField(fill = FieldFill.INSERT)
    private Date createTime;

    @ApiModelProperty("更新时间")
    @TableField(fill = FieldFill.INSERT_UPDATE)
    private Date updateTime;

    @ApiModelProperty("逻辑删除 1删除 0 未删除")
    @TableField(fill = FieldFill.INSERT)
    private Integer deleted;

    @ApiModelProperty("父级菜单权限名称")
    @TableField(exist = false)
    private String pidName;
    
}